import { ILogin } from './data';
import { request } from 'umi';
export async function login(param: ILogin) {
  try {
    const res = await request<{ code: number; data: { token: string } }>(
      'yr/login',
      {
        method: 'post',
        data: {
          ...param,
        },
      },
    );
    return res.data;
  } catch (e) {
    console.log(e);
  }
}
